#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<assert.h>
char* my_strncpy(char* dest, const char* src, size_t num)
{
	char* ret = dest;
	assert(dest && src);
	while (num--)
	{
		*dest++ = *src++;
	}
	return ret;
}
int main()
{
	char str1[] = "abcdef";
	char str2[20] = { 0 };
	my_strncpy(str2, str1, 5);
	printf("%s", str2);
	return 0;
}